package com.longer.demo.biz.service.model;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @program: mybatis
 * @description:
 * @author: SunBiaoLong
 * @create: 2019-01-14 11:08
 **/
@Data
public class ItemModel {
	private Integer id;

	/**
	 * 名称
	 */
	@NotBlank(message = "商品名称不能为空")
	private String title;
	/**
	 * 价格
	 */
	@NotNull(message = "商品价格不能为空")
	@Min(value = 0)
	private BigDecimal price;
	/**
	 * 库存
	 */
	@NotNull(message = "商品库存不能为空")
	private Integer stock;
	/**
	 * 描述
	 */
	@NotNull(message = "描述不能不填写")
	private String description;
	/**
	 * 销量
	 */
	private Integer sales;
	/**
	 * 商品图片的url
	 */
	@NotBlank(message = "商品库存不能为空")
	private String imgUrl;

}
